package com.chinacoal.hr.levelapi.client;

import com.chinacoal.hr.levelapi.client.fallback.AttendanceInfoClientFallback;
import com.chinacoal.hr.levelapi.client.response.Result;
import com.chinacoal.hr.levelapi.entity.AttendanceInfo;
import com.chinacoal.hr.levelapi.entity.InfoSyncVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * Created by jinyabin on 2020/10/29.
 */
@Api(tags = {"考勤信息"})
@FeignClient(name = "ccip-hr-attendance",configuration = FeignAutoConfiguration.class,fallback = AttendanceInfoClientFallback.class)
public interface AttendanceInfoClient {



    /**
     * 考勤信息查询
     *
     * @param page          :当前页数
     * @param limit         :每页条数
     * @param beginDate     :开始日期
     * @param endDate       :结束日期
     * @param empType       :员工类型
     * @param confirmStatus :考勤状态
     * @param empName       :员工姓名
     * @param queryRange    :查询范围（all、dept、person）
     * @return : Result
     * @author : YunTao.Li
     * @date : 2019/11/13 2019/11/13
     */
    @ResponseBody
    @GetMapping("/infos")
    @ApiOperation(value = "查询考勤信息列表")
    public Result list(@ApiParam("当前页数") Long page,
                       @ApiParam("每页条数") Long limit,
                       @ApiParam("组织ID") String orgCode,
                       @ApiParam("部门编码") String deptCode,
                       @ApiParam("部门名称") String deptName,
                       @ApiParam("员工姓名") String empName,
                       @ApiParam("员工编码") String empCode,
                       @ApiParam("考勤状态") String confirmStatus,
                       @ApiParam("开始日期") String beginDate,
                       @ApiParam("结束日期") String endDate,
                       @ApiParam("员工类型") String empType,
                       @ApiParam("查询范围") String queryRange) ;



    /**
     * 根据年月与empid获得某人的考勤异常信息列表
     *
     * @param yrmonth :
     * @param empCode : 员工编码
     * @return : com.chinacoal.hr.levelapi.response.Result
     * @author : YunTao.Li
     * @date : 2019/11/21 2019/11/21
     */
    @ResponseBody
    @GetMapping("/info/exceptions")
    @ApiOperation(value = "查询考勤异常")
    public Result exceptions(@ApiParam("当前页数") Long page,
                             @ApiParam("每页条数") Long limit,
                             @ApiParam("年月") String yrmonth,
                             @ApiParam("年月") String empCode) ;



    /**
     * 新增考勤信息
     *
     * @param attendanceInfo :
     * @return : Result
     * @author : YunTao.Li
     * @date : 2019/11/14 2019/11/14
     */
    @ResponseBody
    @PostMapping("/info")
    @ApiOperation(value = "新增考勤信息")
    public Result add(@RequestBody AttendanceInfo attendanceInfo) ;



    /**
     * @param attendanceInfo :
     * @return : com.chinacoal.hr.levelapi.response.Result
     * @author : YunTao.Li
     * @date : 2019/11/14 2019/11/14
     */
    @ResponseBody
    @PutMapping("/info")
    @ApiOperation(value = "修改考勤信息")
    public Result update(@RequestBody AttendanceInfo attendanceInfo);



    /**
     * 考勤信息同步
     *
     * @return : com.chinacoal.hr.levelimpl.response.Result
     * @author : YunTao.Li
     * @date : 2019/12/20 2019/12/20
     */
    @ResponseBody
    @GetMapping("/info/sync")
    @ApiOperation(value = "同步考勤信息")
    public Result sync();





    /**
     * 考勤信息同步
     *
     * @return : com.chinacoal.hr.levelimpl.response.Result
     * @author : YunTao.Li
     * @date : 2019/12/20 2019/12/20
     */
    @ResponseBody
    @PostMapping("/info/rangesync")
    @ApiOperation(value = "同步考勤信息")
    public Result syncWithRange(@RequestBody InfoSyncVO infoSyncQueryData);

}
